#include<bits/stdc++.h>
using namespace std;
int main()
{
	string a, b, s;
	cin>>s;
	sort(s.begin(), s.end());
	int k = 0;
	while(k < s.size())
	{
		a += s[k++];
		b += s[k++];
	}
	cout<<stoi(a)+stoi(b);
	return 0;
}

